package cn.coldleaf.wiki.configure;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

/**
 * @datetime 2023/10/17 下午5:14
 * @user cold
 **/
@Component
public class WikiMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        long now = System.currentTimeMillis();
        this.strictInsertFill(metaObject,"addTime",Long.class,now);
        this.strictInsertFill(metaObject,"updateTime",Long.class,now);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        long now = System.currentTimeMillis();
        this.strictUpdateFill(metaObject,"updateTime",Long.class,now);
    }
}
